package com.qiao.train.controller;


import com.qiao.train.po.Pay;
import com.qiao.train.po.Reward;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/Reward")
public class RewardController {
    @Autowired
    private com.qiao.train.DAO.RewardDAO RewardDAO;

    @GetMapping("/getAllReward")
    public List<Reward> getAllReward() {
        return RewardDAO.getAllReward();
    }

    @GetMapping("/createReward")
    public int createReward(Reward Reward) {
        return RewardDAO.createReward(Reward);
    }

    @GetMapping("/deleteReward")
    public int deleteReward(int id) {
        return RewardDAO.deleteReward(id);
    }

    @GetMapping("/updateReward")
    public int updateReward(Reward Reward) {
        return RewardDAO.updateReward(Reward);
    }
}
